package com.zhangzc.sc.scthiredoss.exception;


import com.zhangzc.sc.scthiredoss.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice(basePackages = "com/zhangzc/sc/scthiredoss/controller")
@Slf4j
public class UnauthorizedExceptionHandle {

    @ExceptionHandler(value = {Exception.class})
    public R exception(Exception e) {
        log.error("数据获取有问题：{},异常的类型是：{}",e.getMessage(), e.getClass());
        return R.error().put("msg", e.getMessage());
    }
}
